<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        let name = "小明";
        let age = 20;
        let message = "你好," +name + ",你今年" + age + "岁了！";
        alert(message);
        let message_1 = `你好,${name},你今年${age}岁了!`;
        alert(message_1);

          //     获取字符串长度
          let s = "hello world";
              s.length;
          //    获取指定的位置字符
          let  a = 'i love you';
               alert(a[1]);
          //   字符串值不可变
           let S = "Test";
             S[0] = 'x';
             alert(S);
          //     toUpperCase()     大写    toLowerCase()  小写
             let v = "this is a vlog";
             alert(v.toUpperCase());
             alert(v.toLowerCase());
          // 搜索指字符出现的位置
              v.indexOf(
                  "is"
              );
              v.indexOf("n");      //  返回-1
          //  返回指定索引区间的字串
              let c = "this is a world";
              s.substring(1,4);   // his
              s.substring(5);     // i

    </script>
</head>
<body>

</body>
</html>